<com:TPanel id="PortletEditMode" Style="border-bottom: 1px solid black; margin: 0px 0px 0px 0px; text-align: right;">
	<com:TImageButton OnClick="MoveButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/page_next.gif" Text="<%[Move to another area%>" />
	<com:TImageButton OnClick="UpButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/page_up.gif" Text="<%[Move portlet up]%>" />
	<com:TImageButton OnClick="DownButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/page_down.gif" Text="<%[Move portlet down%>" />
	<com:TImageButton OnClick="PropertyButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/application_form.png" Text="<%[Properties]%>" />
	<com:TImageButton OnClick="DeleteButtonClicked" ImageURL="<%=$this->Page->getTheme()->getBaseUrl()%>/images/edit/application_delete.png" Text="<%[Remove portlet]%>" Attributes.onclick="if(!confirm('<%= Prado::localize('Are you sure?') %>')) return false;" />
</com:TPanel>
<com:TPanel Id="SendMailOptions" DefaultButton="SaveSendMailOptions" GroupingText="<%[Send mail options]%>">
	<table width="100%">
		<tr>
			<td><com:TCheckBox Id="SendMailShowLegend" Text="<%[Show Legend text]%>" /></td>
		</tr>
		<tr>
			<td><%[Legend text]%>&nbsp;<com:TTextBox Id="SendMailLegendText" /></td>
		</tr>
		<tr>
			<td><com:TLinkButton Id="SaveSendMailOptions" CssClass="link-button" Text="<%[Save]%>" onClick="SaveSendMailOptionsBtnClicked" /></td>
		</tr>
	</table>
</com:TPanel>
<br />
<com:TPanel id="grpRecipients" GroupingText="<%[Available recipients]%>" Style="width: 100%;">
	<com:TDataList
		ID="dlRecipients"
		DataKeyField="id"
		DataSource="<% $this->TemplateControl->Recipients %>"
		PageSize="5"
		AllowPaging="true"
		AllowCustomPaging="true"
		EnableViewState="true"
		OnEditCommand="editItem"
		OnCancelCommand="cancelItem"
		OnUpdateCommand="updateItem"
		OnDeleteCommand="deleteItem"
		HeaderStyle.CssClass="grid-header"
		HeaderStyle.Width="100%"
		ItemStyle.CssClass="grid-row1"
		ItemStyle.Width="100%"
		AlternatingItemStyle.CssClass="grid-row2"
		EditItemStyle.CssClass="grid-row-edit"
		SelectedItemStyle.CssClass="grid-row-selected"
		OnSelectedIndexChanged="selectItemGroup"
		style="width: 100%;">
		<prop:HeaderTemplate>
			<table border="0" width="100%">
				<tr>
					<td style="width:40%;"><%[Name]%></td>
					<td style="width:40%;"><%[E-Mail]%></td>
					<td style="width:5%;"><%[Active]%></td>
					<td style="width:15%;" style="text-align: right;"><%[Cmd]%></td>
				</tr>
			</table>
		</prop:HeaderTemplate>
		<prop:ItemTemplate>
			<table border="0" width="100%">
				<tr>
				  <td align="left" style="width:40%;"><%# $this->DataItem['name'] %></td>
				  <td align="left" style="width:40%;"><%#$this->DataItem['email'] %></td>
				  <td align="left" style="width:5%;"><%#$this->DataItem['active'] == 1 ? "Yes" : "No" %></td>
				  <td style="text-align: right;" style="width:15%;">
					  <com:TLinkButton Text="<%[Edit]%>" CommandName="edit" />
					  <com:TLinkButton Text="<%[Delete]%>" CommandName="delete" Attributes.onclick="if(!confirm('<%= Prado::localize('Are you sure?') %>')) return false;" />
				  </td>
				</tr>
			</table>
		</prop:ItemTemplate>
		<prop:EditItemTemplate>
			<table border="0" width="100%">
				<tr>
					<td colspan="4"><com:TValidationSummary Display="Dynamic" ValidationGroup="edtrecipientgroup" /></td>
				</tr>
				<tr>
					<td style="width:40%;"><com:TTextBox Columns="30" ID="Name" Text=<%#$this->DataItem['name'] %> /></td>
					<td style="width:40%;">
						<com:TTextBox Columns="30" ID="Email" Text=<%#$this->DataItem['email'] %> />
						<com:TRequiredFieldValidator ControlToValidate="Email" ValidationGroup="edtrecipientgroup" Display="Dynamic" Text="*" ErrorMessage="<%[You need to enter a email address.]%>" ControlCssClass="input-error1" />
						<com:TEmailAddressValidator ControlToValidate="Email" ValidationGroup="edtrecipientgroup" Display="Dynamic" Text="*" ErrorMessage="<%[You entered an invalid email address.]%>" ControlCssClass="input-error2" />
					</td>
					<td style="width:5%;"><com:TCheckBox ID="Active" Text="<%[Active]%>" Checked=<%#$this->DataItem['active'] %>/></td>
					<td style="width:15%;" style="text-align: right;">
						<com:TLinkButton Text="<%[Save]%>" CommandName="update" CausesValidation="true" ValidationGroup="edtrecipientgroup" />
						<com:TLinkButton Text="<%[Cancel]%>" CommandName="cancel" />
					</td>
				</tr>
			</table>
		</prop:EditItemTemplate>
	</com:TDataList>
	<br />
	<br />
	<com:TPanel GroupingText="<%[Add recipient]%>" Style="width: 100%;">
		<table style="width: 100%;">
			<tr>
				<td colspan="3"><com:TValidationSummary Display="Dynamic" ValidationGroup="recipientgroup" /></td>
			</tr>
			<tr>
				<td><com:TLabel Text="<%[Name]%>" /><br />
					<com:TTextBox ID="Name" Columns="35" />
					<com:TRequiredFieldValidator ControlToValidate="Name" ValidationGroup="recipientgroup" Display="Dynamic" Text="*" ErrorMessage="<%[You need to enter a name.]%>" ControlCssClass="input-error1" />
				</td>
				<td>
					<com:TLabel Text="<%[E-Mail]%>" /><br />
					<com:TTextBox ID="Email" Columns="35" />
					<com:TRequiredFieldValidator ControlToValidate="Email" ValidationGroup="recipientgroup" Display="Dynamic" Text="*" ErrorMessage="<%[You need to enter a email address.]%>" ControlCssClass="input-error1" />
					<com:TEmailAddressValidator ControlToValidate="Email" ValidationGroup="recipientgroup" Display="Dynamic" Text="*" ErrorMessage="<%[You entered an invalid email address.]%>" ControlCssClass="input-error2" />
				</td>
				<td>
					<com:TCheckBox ID="Active" Text="<%[Active]%>" />
				</td>
				<td>
					<com:TLinkButton ID="SaveDownLoadGroup" Text="<%[Create]%>" ValidationGroup="recipientgroup" CssClass="link-button" OnClick="createRecipient" />
				</td>
			</tr>
		</table>
	</com:TPanel>
</com:TPanel>
